package com.ruoyi.project.modules.interfaceinfo.mapper;

import java.util.List;

import com.ruoyi.project.modules.interfaceinfo.domain.InterfaceInfo;
import com.ruoyi.project.modules.interfaceinfo.domain.VirtualUsage;
import com.ruoyi.project.modules.interfaceinfo.vo.FieldSourceVo;
import com.ruoyi.project.modules.parameter.domain.InterfaceParamsFieldRelation;
import org.apache.ibatis.annotations.Param;

/**
 * 虚拟用况接口Mapper接口
 * 
 * @author smallrain
 * @date 2021-10-29
 */
public interface VirtualUsageMapper 
{
    /**
     * 查询虚拟用况接口
     * 
     * @param id 虚拟用况接口主键
     * @return 虚拟用况接口
     */
    public VirtualUsage selectVirtualUsageById(Long id);

    /**
     * 查询虚拟用况接口列表
     * 
     * @param virtualUsage 虚拟用况接口
     * @return 虚拟用况接口集合
     */
    public List<VirtualUsage> selectVirtualUsageList(VirtualUsage virtualUsage);

    /**
     * 新增虚拟用况接口
     * 
     * @param virtualUsage 虚拟用况接口
     * @return 结果
     */
    public int insertVirtualUsage(VirtualUsage virtualUsage);

    /**
     * 修改虚拟用况接口
     * 
     * @param virtualUsage 虚拟用况接口
     * @return 结果
     */
    public int updateVirtualUsage(VirtualUsage virtualUsage);
    public int updateVirtualUsageModel(VirtualUsage virtualUsage);

    /**
     * 删除虚拟用况接口
     * 
     * @param id 虚拟用况接口主键
     * @return 结果
     */
    public int deleteVirtualUsageById(Long id);

    /**
     * 批量删除虚拟用况接口
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteVirtualUsageByIds(String[] ids);

    int deleteVirtualUsageByRelationInterfaceId(@Param("ids") List<Long> ids);

    int saveVirtualUsageList(@Param("virtualUsages")  List<VirtualUsage> virtualUsages, @Param("id")  Long id);

    List<VirtualUsage> selectVirtualUsages(@Param("virtualUsage")  VirtualUsage virtualUsage);

    int selectMaxSortNum(@Param("relationInterfaceId") Long relationInterfaceId);

    int saveVirtualUsageListNew(@Param("list") List<VirtualUsage> virtualUsages);

    List<InterfaceParamsFieldRelation> queryInterfaceParam(@Param("virtualUsages") List<VirtualUsage> virtualUsages, @Param("type") String type);

    void updateInterfaceSort(@Param("virtualUsages") List<VirtualUsage> virtualUsages);

    List<FieldSourceVo> queryFieldSource1(@Param("ids1") List<Long> ids1);

    List<FieldSourceVo> queryFieldSource2(@Param("ids2") List<Long> ids2);

    List<Long> queryInterfaceId(@Param("interfaceModel") String interfaceModel, @Param("interfaceIds") List<Long> interfaceIds);

    List<Long> queryInterfaceId2(@Param("interfaceAllowEmptyModel") String interfaceAllowEmptyModel, @Param("interfaceIds") List<Long> interfaceIds);
}
